<%@page import="utils.SuperString"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@page import="java.util.Date"%>
<%@page import="java.util.List"%>
<%@page import="feedme.dao.*"%>
<%@page import="feedme.bean.*"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>.
<%@page import="utils.SuperString"%>
<%@page import="org.apache.commons.logging.Log" %>
<%@page import="org.apache.commons.logging.LogFactory" %>

<%!
static private Log logger = LogFactory.getLog("foodserver_moddo");
%>

<%
String act = SuperString.notNullTrim(request.getParameter("act"));
String name = SuperString.notNullTrim(request.getParameter("name"));
String tel = SuperString.notNullTrim(request.getParameter("tel"));
String price = SuperString.notNullTrim(request.getParameter("price"));
String fsId = SuperString.notNullTrim(request.getParameter("fsId"));
logger.info("act:" + act);
logger.info("name:" + name);
logger.info("tel:" + tel);
logger.info("fsId:" + fsId);


WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(request.getServletContext());
DaoFactory daoFactory = ctx.getBean("mongoDaoFactory", DaoFactory.class);
FoodServerDao fsDao = daoFactory.getFoodServerDaoInstance();
FoodDao fDao = daoFactory.getFoodDaoInstance();

if(act.equalsIgnoreCase("add")){
    FoodBean fBean = new FoodBean();
    fBean.setName(name);
    fBean.setPrice(price);
	fDao.save(fBean);
	
	logger.debug("order_mod.jsp?act=add&type=food");
	response.sendRedirect("order_mod.jsp?act=add&type=food`    ");
}

%>

操作完成，等待跳转。。。。。。

